package ebj.common.reflection;

import java.lang.reflect.Constructor;

import ebj.common.proxy.Person;
import ebj.common.utils.Utils;

/**
 * 反射实例6：获得其他类中的全部构造函数
 * @author zhouxiangyong
 * @version $Id$
 */
public class ReflectClient6 {
	public static void main(String[] args) {
	String clazzName = Utils.getProperty("Person");
	Class<?> clazz = null;
	Person person = null;
	
	try {
		clazz = Class.forName(clazzName);
	} catch (ClassNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	try {
		person = (Person) clazz.newInstance();
	} catch (InstantiationException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (IllegalAccessException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	Constructor<?>[] constructors = clazz.getConstructors();
	for (Constructor<?> constructor : constructors) {
		System.out.println(constructor);
	}
	
}
}
